<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:62:"/var/www/fish/application/crm/view/ordermanager/editOrder.html";i:1519718350;}*/ ?>
<!DOCTYPE html>
<html>
    
    <head>
        <meta charset="UTF-8">
		<title>小鱼ADMIN</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
		<link rel="stylesheet" href="/public/static/css/font.css">
		<link rel="stylesheet" href="/public/static/css/bgadmin.css">
		<script type="text/javascript" src="/public/static/js/jquery-1.8.0.min.js"></script>
		<script type="text/javascript" src="/public/static/lib/layui/layui.js" charset="utf-8"></script>
		<script type="text/javascript" src="/public/static/js/bgadmin.js"></script>
		<script type="text/javascript" src="/public/static/js/jquery.form.js"></script>
		<script>
		//订单操作
		$(function(){
			var order_status2 = '<?php echo $arrData['order_status']; ?>'; //订单状态
			var pay_status2 = '<?php echo $arrData['pay_status']; ?>';  //付款状态
			var shipping_status2 = '<?php echo $arrData['shipping_status']; ?>';  //发货状态
			var delivery_order = '<?php echo $arrData['delivery_order']; ?>';
			var payment = '<?php echo $arrData['payment']; ?>';   //支付方式
			//alert(delivery_order);
			if(pay_status2 == 'N'  && shipping_status2 == '0'){
				if(order_status2 == '3' || order_status2 == '2' || order_status2 == '4'){
					if('<?php echo $username; ?>' == 'admin' || "<?php echo $priv['confirm_order']; ?>" == 'Y'){
						//$("#confirm_order").css("display","inline");  //确认订单---可能要打开
						$("#confirm_todelivery_order").css("display","inline");  //直接发货	
						$("#confirm_notby_order").css("display","inline");  //未通过
						$("#confirm_suspected_order").css("display","inline");  //问题单
						
						
						$("#express_delivery").css("display","inline");  //发货方式
						//$("#id_shopping_name").combobox("setValue","1");  //顺丰快递
					}
				}else if(order_status2 == '1' || order_status2 == '8'){
					if('<?php echo $username; ?>' == 'admin' || "<?php echo $priv['finance']; ?>" == 'Y'){
						if(payment == "3"){
							$("#confirm_pay").css("display","none");  //付款
							$("#defray").css("display","none");  //付款
							$("#confirm_picking").css("display","inline"); //配货
						}else{
							$("#confirm_pay").css("display","inline");  //付款
							$("#defray").css("display","inline");  //付款
							$("#confirm_picking").css("display","none"); //配货
						}
					}
					if('<?php echo $username; ?>' == 'admin' || "<?php echo $priv['confirm_order']; ?>" == 'Y'){
						$("#confirm_null").css("display","inline");  //无效
						$("#confirm_cancel").css("display","inline");  //取消
					}
				}else if(order_status2 == '7'){
					if('<?php echo $username; ?>' == 'admin' || "<?php echo $priv['confirm_order']; ?>" == 'Y'){
						$("#confirm_null").css("display","inline");  //无效
						$("#confirm_cancel").css("display","inline");  //取消
					}
				}
			}
			if(pay_status2 == 'Y' && shipping_status2 == '0'){
				if('<?php echo $username; ?>' == 'admin' || "<?php echo $priv['finance']; ?>" == 'Y'){
					$("#confirm_not_pay").css("display","inline"); //设为未付款
				}
				if('<?php echo $username; ?>' == 'admin' || "<?php echo $priv['package']; ?>" == 'Y'){
					$("#confirm_picking").css("display","inline"); //配货
					//$("#confirm_delivery").css("display","inline");   //生成发货单
				}
				if('<?php echo $username; ?>' == 'admin' || "<?php echo $priv['confirm_order']; ?>" == 'Y'){
					$("#confirm_cancel").css("display","inline");  //取消
				}
			}else if( shipping_status2 == '3' && (!delivery_order || delivery_order == "not")){
				if('<?php echo $username; ?>' == 'admin' || "<?php echo $priv['finance']; ?>" == 'Y'){
					$("#confirm_not_pay").css("display","inline"); //设为未付款
				}
				if('<?php echo $username; ?>' == 'admin' || "<?php echo $priv['package']; ?>" == 'Y'){
					$("#confirm_delivery").css("display","inline");   //生成发货单
				}
				if('<?php echo $username; ?>' == 'admin' || "<?php echo $priv['confirm_order']; ?>" == 'Y'){
					$("#confirm_cancel").css("display","inline");  //取消
				}
			}else if(shipping_status2 == '3' && delivery_order  && delivery_order != "not"){
				if('<?php echo $username; ?>' == 'admin' || "<?php echo $priv['package']; ?>" == 'Y'){
					$("#confirm_ship").css("display","inline");  //发货
					//$("#express_delivery").css("display","inline");  //发货方式
					$("#wlh").css("display","inline");  //物流号
				}
				//12-18--add
				if('<?php echo $username; ?>' == 'admin' || "<?php echo $priv['confirm_order']; ?>" == 'Y'){
					$("#confirm_null").css("display","inline");  //无效
					$("#confirm_cancel").css("display","inline");  //取消
				}
			}else if(shipping_status2 == '1' || shipping_status2 == '2' ){
				//$("#confirm_not_ship").css("display","inline");  //未发货
				if('<?php echo $username; ?>' == 'admin' || "<?php echo $priv['package']; ?>" == 'Y'){
					//让确认收货 的把 已收货 按钮隐藏
					if(shipping_status2 == '2'){
						//货到付款处理
						if(payment == '3'){
							//$("#id_payment").combobox("setValue","3");
							$("#confirm_pay").css("display","inline");  //付款
							//$("#defray").css("display","inline");  //付款
						}
						$("#confirm_receipt").css("display","none");  //已收货
					}else{
						$("#confirm_receipt").css("display","inline");  //已收货
					}
					//$("#confirm_receipt").css("display","inline");  //已收货
					$("#confirm_reset").css("display","inline");  //退货
					
				}
			}
		})
		</script>	
    </head>
    
    <body>
        <div class="bg-body">
            <form  action="#" method="post" id="mainForm" class="layui-form">
                <div class="layui-form-item">
                    <div class="layui-inline">
						<label class="layui-form-label">
							<span class="bg-red">*&nbsp;&nbsp;</span>收货人：
						</label>
						<div class="layui-input-inline">
							<input type="text" id="consignee_id" name="consignee" required="" lay-verify="required"
							autocomplete="off" readonly value="<?php echo $arrData['consignee']; ?>" class="layui-input">
						</div>
					</div>
					<div class="layui-inline">
						<label class="layui-form-label">
							<span class="bg-red">*&nbsp;&nbsp;</span>下单时间：
						</label>
						<div class="layui-input-inline">
							<input type="text" id="createtime_id" name="createtime" required="" lay-verify="required"
							autocomplete="off" readonly value="<?php echo $arrData['createtime']; ?>" class="layui-input">
						</div>
					</div>
					<?php if(($username == 'admin') OR ($priv['display_phone'] == 'Y')): ?>
					<div class="layui-inline">
						<label class="layui-form-label">
							<span class="bg-red">*&nbsp;&nbsp;</span>收货手机：
						</label>
						<div class="layui-input-inline">
							<input type="text" id="phone_id" name="phone" required="" lay-verify="required"
							autocomplete="off" readonly value="<?php echo $arrData['phone']; ?>" class="layui-input">
						</div>
					</div>
					<div class="layui-inline">
						<label class="layui-form-label">
							<span class="bg-red">*&nbsp;&nbsp;</span>收货电话：
						</label>
						<div class="layui-input-inline">
							<input type="text" id="telephone_id" name="telephone" required="" lay-verify="required"
							autocomplete="off" readonly value="<?php echo $arrData['telephone']; ?>" class="layui-input">
						</div>
					</div>
					<?php endif; ?>
					<div class="layui-form-item layui-form-text">
						<label for="desc" class="layui-form-label">
							收货地址：
						</label>
						<div class="layui-input-block">
							<input type="text" name="delivery_address" id="delivery_address_id" lay-verify="" autocomplete="off" placeholder="请输入收货地址" readonly value="<?php echo $arrData['delivery_address']; ?>" class="layui-input" >
						</div>
					</div>
					<div class="layui-form-item layui-form-text">
						<label for="desc" class="layui-form-label">
							订单描述：
						</label>
						<div class="layui-input-block">
							<input type="text" name="description" id="description_id" autocomplete="off" readonly value="<?php echo $arrData['description']; ?>" class="layui-input" >
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label"></label>
						<a class="layui-btn layui-btn-warm" id="" lay-filter="" onclick="call1('<?php echo $arrData['customer_code']; ?>');"><i class="iconfont1">&#xe6f1; </i>拨号1</a>
						<a class="layui-btn layui-btn-warm" id="" lay-filter=""><i class="iconfont1">&#xe6ec; </i>拨号2</a>
					</div>
			    </div>	
			
                <fieldset class="layui-elem-field layui-field-title">
				  <legend>商品信息</legend>
				</fieldset>
				
				<div class="layui-form-item">
					<div class="layui-inline">
					  <label class="layui-form-label">是否修改价格</label>
						<div class="layui-input-inline">
							<select name="modify_price" disabled id="modify_price_id" lay-verify="required">
							  <option value="N">否</option>
							  <option value="Y">是</option>
							</select>
						</div>
					</div>
					<div class="layui-inline">
						<label class="layui-form-label">
							<span class="bg-red">*&nbsp;&nbsp;</span>应付金额：
						</label>
						<div class="layui-input-inline">
							<input type="text" readonly id="cope_money_id" 
							autocomplete="off" value="<?php echo $arrData['cope_money']; ?>" class="layui-input">
						</div>
					</div>
				</div>
				
				<table class="layui-table" lay-data="{id: 'idTest', url:'/index.php/crm/Ordermanager/orderGoods?id=<?php echo $arrData['id']; ?>'}" lay-filter="demo">
				  <thead>
					<tr>
						<th lay-data="{checkbox:true, LAY_CHECKED: true}"></th>
						<th lay-data="{field:'id', align:'center', width:60 }">编号</th>
						<th lay-data="{field:'good_name', align:'center', width:160 }">商品名称</th>
						<th lay-data="{field:'good_num', width:100,sort: true}">商品货号</th>
						<th lay-data="{field:'price', width:100,sort: true, edit: 'text'}">商品价格</th>
						<th lay-data="{field:'cat_name', width:100 }">商品分类</th>
						<th lay-data="{field:'goods_num', width:100 }">商品数量</th>
						<th lay-data="{field:'goods_money', width:100 }">商品总价格</th>
						<th lay-data="{field:'simple_description', width:200}">描述</th>
						<!--<th lay-data="{fixed: 'right', width:100, align:'center', toolbar: '#barDemo'}">操作</th>-->
					 </tr>
				  </thead>
				</table>
				 
				<script type="text/html" id="barDemo">
				  <a class="layui-btn layui-btn-mini" lay-event="delete">清除商品</a>
				</script>
            </form>
			<fieldset class="layui-elem-field layui-field-title">
				  <legend>设置操作信息</legend>
			</fieldset>
			<form class="layui-form" action="" id="operateFrom">
				<div class="layui-form-item" id="express_delivery" style="display:none;" >
					<div class="layui-inline"  >
						<label class="layui-form-label">配送方式：</label>
						<div class="layui-input-block">
						  <select name="shopping_name" id="id_shopping_name">
							<option value=""></option>
							<?php if(is_array($Logistics) || $Logistics instanceof \think\Collection || $Logistics instanceof \think\Paginator): $i = 0; $__LIST__ = $Logistics;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
							<option value="<?php echo $vo['id']; ?>"><?php echo $vo['name']; ?></option>
							<?php endforeach; endif; else: echo "" ;endif; ?>
							<!--<option value="1" selected="">顺丰快递</option>
							<option value="3">EMS</option>
							<option value="5">申通</option>-->
						  </select>
						</div>
					</div>
				</div>
				<div class="layui-form-item"  id="wlh"  style="display:none;" >
					<div class="layui-inline">
						<label class="layui-form-label">
							物流单号：
						</label>
						<div class="layui-input-inline">
							<input type="text" name="logistics_account" id="id_logistics_account" placeholder="请输入物流单号" class="layui-input">
						</div>
					</div>
				</div>
				<div class="layui-form-item"  id="defray" style="display:none;" >
					<div class="layui-inline"  >
						<label class="layui-form-label">支付方式：</label>
						<div class="layui-input-block">
						  <select id="id_payment" name="payment" >
							<option value=""></option>
							<option value="1">余额支付</option>
							<option value="2" selected="">银行汇款/转帐</option>
							<option value="3">货到付款</option>
						  </select>
						</div>
					</div>
				</div>
			  
				<div class="layui-form-item layui-form-text">
					<label class="layui-form-label">操作描述：</label>
					<div class="layui-input-block">
						<input type="text" name="description" id="id_description" lay-verify="" autocomplete="off" placeholder="请输入操作描述" class="layui-input">
					</div>
				</div>
			  
				<div class="layui-form-item">
					<input type="hidden" name="id" value="<?php echo $arrData['id']; ?>" />
					<input type="hidden" name="createname" value="<?php echo $arrData['createname']; ?>" />
					<input type="hidden" name="order_num2" value="<?php echo $arrData['order_num']; ?>" />
					<input type="hidden" name="customer_code" value="<?php echo $arrData['customer_code']; ?>" />
					<div class="layui-input-block">
					  <li style="display:none;"  id="confirm_todelivery_order"><a ac="status" saveStatus="confirm_todelivery_order" class="layui-btn layui-btn-primary">确认订单</a>
					  <li style="display:none;" id="confirm_notby_order"><a ac="status" saveStatus="confirm_notby_order" class="layui-btn">未通过</a></li>
					  <li style="display:none;" id="confirm_suspected_order"><a ac="status" saveStatus="confirm_suspected_order" class="layui-btn layui-btn-primary">问题单</a></li>
					  <li style="display:none;" id="confirm_pay"><a ac="status" saveStatus="confirm_pay" class="layui-btn">付款</a></li>
					  <li style="display:none;" id="confirm_pay_mod"><a ac="status" saveStatus="confirm_pay_mod" class="layui-btn layui-btn-primary" >付款方式</a></li>
					  <li style="display:none;" id="confirm_not_pay"><a ac="status" saveStatus="not_pay" class="layui-btn">设为未付款</a></li>
					  <li style="display:none;" id="confirm_picking"><a ac="status" saveStatus="picking_ship" class="layui-btn layui-btn-primary">配货</a></li>
					  <li style="display:none;" id="confirm_delivery"><a ac="status" saveStatus="delivery_ship" class="layui-btn">生成发货单</a></li>
					  <li style="display:none;" id="confirm_ship"><a ac="status" saveStatus="confirm_ship" class="layui-btn layui-btn-primary">发货</a></li>
					  <li style="display:none;" id="confirm_receipt"><a ac="status" saveStatus="receipt_ship" class="layui-btn">已收货</a></li>
					  <li style="display:none;" id="confirm_not_ship"><a ac="status" saveStatus="not_ship" class="layui-btn layui-btn-primary">未发货</a></li>
					  <li style="display:none;" id="confirm_cancel"><a ac="status" saveStatus="cancel_order" class="layui-btn">取消</a></li>
					  <li style="display:none;" id="confirm_null"><a ac="status" saveStatus="not_order" class="layui-btn layui-btn-primary">待审核</a></li>
					  <li style="display:none;" id="confirm_reset"><a ac="status" saveStatus="reset_order" class="layui-btn">退货</a></li>
					</div>
				</div>
			</form>
			
        </div>
    </body>
	<script type="text/javascript" src="/public/static/crm/js/orderManager/editOrder.js"></script>
	<script type="text/javascript">
	$(function(){
		$("#modify_price_id").val("<?php echo $arrData['modify_price']; ?>");
	})

	var exten = "<?php echo $_SESSION['user_info']['extension']; ?>";
	function call1(customer_code){
		// alert(customer_code);return false;
		$.ajax({
			type : 'post',
			url : '/index.php/crm/Pbx/call1',
			data : {src_exten:exten,customer_code:customer_code},
			dataType : 'json',
			success : function (result) {
				if (result.success) {  
					
				} else {  
					
				}
			}
		})
		
	}
	</script>
</html>